import { createRouter, createWebHistory } from 'vue-router'

// 使用动态导入（Dynamic Import）实现路由懒加载
const adminiStration = () => import('../components/adminiStration.vue') // 值班管理
const AssessCom = () => import('../components/AssessCom.vue') // 评估分析
const DetectionCom = () => import('../components/DetectionCom.vue') // 远程监测
const earlyWarning = () => import('../components/earlyWarning.vue') // 报警预警
const EquipmentCom = () => import('../components/EquipmentCom.vue') // 设备分析
const instructionsCom = () => import('../components/instructionsCom.vue') // 调度指令
const overView = () => import('../components/overView.vue') // 调度总览
const trafficStatistics = () => import('../components/trafficStatistics.vue') // 流量统计
const waterStatistics = () => import('../components/waterStatistics.vue') // 水质统计
const workManship = () => import('../components/workManship.vue') // 厂站工艺
const StressStatistics = () => import('../components/StressStatistics.vue') // 压力统计

const routes = [
  {
    path: '/adminiStration',
    name: '值班管理',
    component: adminiStration,
  },
  {
    path: '/AssessCom',
    name: '评估分析',
    component: AssessCom,
  },
  {
    path: '/DetectionCom',
    name: '远程监测',
    component: DetectionCom,
  },
  {
    path: '/earlyWarning',
    name: '报警预警',
    component: earlyWarning,
  },
  {
    path: '/EquipmentCom',
    name: '设备分析',
    component: EquipmentCom,
  },
  {
    path: '/instructionsCom',
    name: '调度指令',
    component: instructionsCom,
  },
  {
    path: '/overView',
    name: '调度总览',
    component: overView,
  },
  {
    path: '/trafficStatistics',
    name: '流量统计',
    component: trafficStatistics,
  },
  {
    path: '/waterStatistics',
    name: '水质统计',
    component: waterStatistics,
  },
  {
    path: '/workManship',
    name: '厂站工艺',
    component: workManship,
  },
  {
    path: '/StressStatistics',
    name: '压力统计',
    component: StressStatistics,
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export { router, routes }
